package com.wan.net.core;

import com.wan.net.handler.ProtobufServerChannelHandler;
import com.wan.net.rpc.handler.RpcServerHandler;
import io.netty.channel.ChannelHandler;

public enum ServerType implements AssignHandler{
    TCP(ProtobufServerChannelHandler.class),
    UDP(ProtobufServerChannelHandler.class),
    RPC(RpcServerHandler.class),
    WEB_SOCKET(ProtobufServerChannelHandler.class),

    ;
    private final Class<? extends ChannelHandler> defaultHandler;

    ServerType(Class<? extends ChannelHandler> defaultHandler) {
        this.defaultHandler = defaultHandler;
    }

    @Override
    public Class<? extends ChannelHandler> getAssignHandler() {
        return defaultHandler;
    }
}
